//
// Created by LiuDongPeng on 2023/11/29.
//

#include "encoder.h"



/**
 * @brief Encoder init
 * @param[out]  encoder
 * @param[in]   encoderGetDataHandle
 * @return
 */
int encoder_init(encoder_t* encoder, encoder_get_data_callback_t encoderGetDataHandle)
{
    if (!encoder)
        return -1;

    if (!encoderGetDataHandle)
        return -2;

    encoder->encoderGetDataCallback = encoderGetDataHandle;

    return 0;
}

